package com.wxg.study.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.wxg.study.service.HelloService;

@RestController
public class HelloController {
	
	final Logger logger = LoggerFactory.getLogger(HelloController.class);
	
	/**
	 * 不添加 {@link Autowired} 注解，看看报错日志，了解常见的日志输出信息。
	 */
	@Autowired
	HelloService helloService;
	
	@RequestMapping("/hello")
	public String hello(@RequestParam(value = "name", required = false) String name) {
		return helloService.hello(name);
	}
}
